package jaxb;

import java.io.File;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

public class XML2Object {

	public static void main(String[] args) throws Exception {
		File file = new File("d:\\file.xml");
		try {
			JAXBContext jAXBContext = JAXBContext.newInstance(Customer.class);
			Unmarshaller unmarshaller = jAXBContext.createUnmarshaller();
			Customer customer =null;
			customer = (Customer)unmarshaller.unmarshal(file);
			System.out.print(customer.getId());
		} catch (JAXBException e) {
			e.printStackTrace();
		}
	}

}
